<template>
	<view class="downPage" :style="{ height: windowHeight + 'px'}">
		<image class="img" src="../static/images/index/logo.png"></image>
		<view class="title">易联道商城</view>
		<view class="eqcord" v-if="downConfig">
			<image class="eqImg" :src="downConfig.android_image"></image>
		</view>
		<view class="footer" v-if="downConfig">
			<!-- <view class="box">ios下载app</view> -->
			<view class="box" @click="downLoad">android下载app</view>
		</view>
	</view>
</template>
<script>
	import {
		mapState
	} from "vuex";
	export default {
		data() {
			return {
				windowHeight: 0,
				statusBar: 0,
				countdown: 3, // 修改广告倒计时
				cTimer: null,
				downConfig: null,
			};
		},
		computed: {
			...mapState(["common"]),
		},
		onReady() {
			var wanlsys = this.$wanlshop.wanlsys();
			this.windowHeight = wanlsys.windowHeight;
		},
		onLoad() {
			this.getDownConfig()
		},
		methods: {
			getDownConfig() {
				uni.request({
					url: '/index/android',
					complete: res => {
						if (res.res.code === 1) {
							this.downConfig = res.data
						}
					}
				});
			},
			downLoad() {
				window.location.href = this.downConfig.android_url
			}
		},
	};
</script>

<style lang="scss">
	.downPage {
		position: relative;
		width: 100%;
		height: 100vh;
		background-image: url("@/static/images/index/app.png");
		background-repeat: no-repeat;
		background-size: 100% 100%;
		overflow: hidden;

		.img {
			width: 152rpx;
			height: 152rpx;
			display: flex;
			margin: 194rpx auto 30rpx;
		}

		.title {
			font-size: 40rpx;
			text-align: center;
			color: #fff;
		}

		.eqcord {
			width: 500rpx;
			height: 500rpx;
			margin: 40rpx auto 0;

			.eqImg {
				width: 100%;
				height: 100%;
			}
		}

		.footer {
			margin-top: 100rpx;
			width: 100%;
			display: flex;
			justify-content: center;

			.box {
				width: 344rpx;
				padding: 30rpx 0;
				background: #ffffff;
				border-radius: 16rpx 16rpx 16rpx 16rpx;
				font-size: 28rpx;
				color: #327CFF;
				text-align: center;
			}

			.box:nth-child(2) {
				margin-left: 18rpx;
			}
		}
	}
</style>